/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('dypnsapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CheckSmsVerifyCodeRequest {
  caseAuthPolicy?: long(name='CaseAuthPolicy', description='The verification policy for uppercase and lowercase letters of the verification code. Valid values:

*   1: The verification policy does not distinguish uppercase and lowercase letters.
*   2: The verification policy distinguishes uppercase and lowercase letters.', example='1'),
  countryCode?: string(name='CountryCode', description='The country code of the phone number. Default value: 86.', example='86'),
  outId?: string(name='OutId', description='The external ID.', example='12123231'),
  ownerId?: long(name='OwnerId'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number.

This parameter is required.', example='18653529399'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemeName?: string(name='SchemeName', description='The verification service name. If this parameter is not specified, the default service is used. The name can be up to 20 characters in length.', example='Aliyun'),
  verifyCode?: string(name='VerifyCode', description='The verification code.

This parameter is required.', example='1231'),
}

model CheckSmsVerifyCodeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.', example='None'),
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [Response codes](https://help.aliyun.com/zh/pnvs/developer-reference/api-return-code?spm=a2c4g.11174283.0.0.70c5616bkj38Wa).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  model?: {
    outId?: string(name='OutId', description='The external ID.', example='1212312'),
    verifyResult?: string(name='VerifyResult', description='The verification results. Valid values:

*   PASS: The verification is successful.
*   UNKNOWN: The verification failed.', example='PASS'),
  }(name='Model', description='The returned data.'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   true
*   false', example='false'),
}

model CheckSmsVerifyCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckSmsVerifyCodeResponseBody(name='body'),
}

/**
 * @summary Verifies SMS verification codes.
 *
 * @param request CheckSmsVerifyCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckSmsVerifyCodeResponse
 */
async function checkSmsVerifyCodeWithOptions(request: CheckSmsVerifyCodeRequest, runtime: Util.RuntimeOptions): CheckSmsVerifyCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.caseAuthPolicy)) {
    query['CaseAuthPolicy'] = request.caseAuthPolicy;
  }
  if (!Util.isUnset(request.countryCode)) {
    query['CountryCode'] = request.countryCode;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemeName)) {
    query['SchemeName'] = request.schemeName;
  }
  if (!Util.isUnset(request.verifyCode)) {
    query['VerifyCode'] = request.verifyCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckSmsVerifyCode',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies SMS verification codes.
 *
 * @param request CheckSmsVerifyCodeRequest
 * @return CheckSmsVerifyCodeResponse
 */
async function checkSmsVerifyCode(request: CheckSmsVerifyCodeRequest): CheckSmsVerifyCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkSmsVerifyCodeWithOptions(request, runtime);
}

model CreateSchemeConfigRequest {
  androidPackageName?: string(name='AndroidPackageName', description='The package name. This parameter is required when Platform is set to Android. The name must be 1 to 128 characters in length and can contain digits, letters, hyphens (-), underscores (_), and periods (.).', example='com.aliyun.android'),
  androidPackageSign?: string(name='AndroidPackageSign', description='The package signature. This parameter is required when Platform is set to Android. The signature must be 32 characters in length and can contain digits and letters.', example='dfsfaawklll1****olkweklk***'),
  appName?: string(name='AppName', description='The app name, which can be up to 20 characters in length and can contain letters.', example='Alibaba Cloud Communications'),
  h5Origin?: string(name='H5Origin', description='The reserved field. HTML5 apps are not supported.', example='-'),
  h5Url?: string(name='H5Url', description='The reserved field. HTML5 apps are not supported.', example='-'),
  iosBundleId?: string(name='IosBundleId', description='The bundle ID. This parameter is required when OsType is set to iOS. The bundle ID must be 1 to 128 characters in length and can contain digits, letters, hyphens (-), underscores (_), and periods (.).', example='com.aliyun.ios'),
  ownerId?: long(name='OwnerId'),
  platform?: string(name='Platform', description='The app platform.

Valid values:

*   Android
*   iOS

This parameter is required.', example='Android'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemeName?: string(name='SchemeName', description='The service name, which can be up to 10 characters in length and can contain letters.

This parameter is required.', example='Aliyun'),
}

model CreateSchemeConfigResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/zh/pnvs/developer-reference/api-return-code?spm=a2c4g.11186623.0.0.5c3a662fbgeAuk).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  model?: {
    schemeCode?: string(name='SchemeCode', description='The service code.', example='FA100000168468035'),
  }(name='Model', description='The returned results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B95B36EC-8108-4479-D3AA-2BB27F9B155A'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   **true**
*   **false**', example='false'),
}

model CreateSchemeConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSchemeConfigResponseBody(name='body'),
}

/**
 * @summary Creates a code for a converged communication authentication service.
 *
 * @param request CreateSchemeConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSchemeConfigResponse
 */
async function createSchemeConfigWithOptions(request: CreateSchemeConfigRequest, runtime: Util.RuntimeOptions): CreateSchemeConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidPackageName)) {
    query['AndroidPackageName'] = request.androidPackageName;
  }
  if (!Util.isUnset(request.androidPackageSign)) {
    query['AndroidPackageSign'] = request.androidPackageSign;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.h5Origin)) {
    query['H5Origin'] = request.h5Origin;
  }
  if (!Util.isUnset(request.h5Url)) {
    query['H5Url'] = request.h5Url;
  }
  if (!Util.isUnset(request.iosBundleId)) {
    query['IosBundleId'] = request.iosBundleId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.platform)) {
    query['Platform'] = request.platform;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemeName)) {
    query['SchemeName'] = request.schemeName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSchemeConfig',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a code for a converged communication authentication service.
 *
 * @param request CreateSchemeConfigRequest
 * @return CreateSchemeConfigResponse
 */
async function createSchemeConfig(request: CreateSchemeConfigRequest): CreateSchemeConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSchemeConfigWithOptions(request, runtime);
}

model CreateVerifySchemeRequest {
  appName?: string(name='AppName', description='The app name.

This parameter is required.', example='Alibaba Cloud Communications'),
  authType?: string(name='AuthType', description='The verification type. You can select multiple types only when the phone number verification is supported. Separate multiple types with commas (,).

*   **1**: phone number verification
*   **2**: SMS verification', example='1,2'),
  bundleId?: string(name='BundleId', description='The bundle ID. This parameter is required when OsType is set to iOS. The bundle ID must be 1 to 128 characters in length and can contain digits, letters, hyphens (-), underscores (_), and periods (.).', example='example.aliyundoc.com'),
  cmApiCode?: long(name='CmApiCode', description='The channel code of China Mobile.', example='1'),
  ctApiCode?: long(name='CtApiCode', description='The channel code of China Telecom.', example='3'),
  cuApiCode?: long(name='CuApiCode', description='The channel code of China Unicom.', example='2'),
  email?: string(name='Email', description='The email address that receives the key.', example='username@aliyundoc.com'),
  hmAppIdentifier?: string(name='HmAppIdentifier'),
  hmPackageName?: string(name='HmPackageName'),
  hmSignName?: string(name='HmSignName'),
  ipWhiteList?: string(name='IpWhiteList', description='The IP address whitelist.', example='139.9.167.181
122.112.210.205
139.9.172.0/24'),
  origin?: string(name='Origin', description='The source URL of the HTML5 app page. We recommend that you specify this parameter as a domain name.', example='https://h5.minexiot.com'),
  osType?: string(name='OsType', description='The type of the operating system for the terminal. Valid values: iOS and Android.

This parameter is required.', example='iOS'),
  ownerId?: long(name='OwnerId'),
  packName?: string(name='PackName', description='The package name. This parameter is required when OsType is set to Android. The name must be 1 to 128 characters in length and can contain digits, letters, hyphens (-), underscores (_), and periods (.).', example='com.aliyun'),
  packSign?: string(name='PackSign', description='The package signature. This parameter is required when OsType is set to Android. The signature must be 32 characters in length and can contain digits and letters.', example='123aliyun'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sceneType?: string(name='SceneType', description='The service type.', example='0'),
  schemeName?: string(name='SchemeName', description='The service name.

This parameter is required.', example='Aliyun'),
  smsSignName?: string(name='SmsSignName', description='The bound SMS signature. This parameter is valid only when AuthType is set to 2. The signature must be approved.', example='Aliyun Test'),
  url?: string(name='Url', description='The URL of the HTML5 app page.', example='https://h5.minexiot.com/index.html'),
}

model CreateVerifySchemeResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  gateVerifySchemeDTO?: {
    schemeCode?: string(name='SchemeCode', description='The service code.', example='FC10001287****'),
  }(name='GateVerifySchemeDTO', description='The response parameters.'),
  httpStatusCode?: long(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='A1E75E69-3049-5FDB-A376-D745837CD2B1'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateVerifySchemeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateVerifySchemeResponseBody(name='body'),
}

/**
 * @summary Creates a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CreateVerifySchemeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateVerifySchemeResponse
 */
async function createVerifySchemeWithOptions(request: CreateVerifySchemeRequest, runtime: Util.RuntimeOptions): CreateVerifySchemeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.authType)) {
    query['AuthType'] = request.authType;
  }
  if (!Util.isUnset(request.bundleId)) {
    query['BundleId'] = request.bundleId;
  }
  if (!Util.isUnset(request.cmApiCode)) {
    query['CmApiCode'] = request.cmApiCode;
  }
  if (!Util.isUnset(request.ctApiCode)) {
    query['CtApiCode'] = request.ctApiCode;
  }
  if (!Util.isUnset(request.cuApiCode)) {
    query['CuApiCode'] = request.cuApiCode;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.hmAppIdentifier)) {
    query['HmAppIdentifier'] = request.hmAppIdentifier;
  }
  if (!Util.isUnset(request.hmPackageName)) {
    query['HmPackageName'] = request.hmPackageName;
  }
  if (!Util.isUnset(request.hmSignName)) {
    query['HmSignName'] = request.hmSignName;
  }
  if (!Util.isUnset(request.ipWhiteList)) {
    query['IpWhiteList'] = request.ipWhiteList;
  }
  if (!Util.isUnset(request.origin)) {
    query['Origin'] = request.origin;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.packName)) {
    query['PackName'] = request.packName;
  }
  if (!Util.isUnset(request.packSign)) {
    query['PackSign'] = request.packSign;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sceneType)) {
    query['SceneType'] = request.sceneType;
  }
  if (!Util.isUnset(request.schemeName)) {
    query['SchemeName'] = request.schemeName;
  }
  if (!Util.isUnset(request.smsSignName)) {
    query['SmsSignName'] = request.smsSignName;
  }
  if (!Util.isUnset(request.url)) {
    query['Url'] = request.url;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateVerifyScheme',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CreateVerifySchemeRequest
 * @return CreateVerifySchemeResponse
 */
async function createVerifyScheme(request: CreateVerifySchemeRequest): CreateVerifySchemeResponse {
  var runtime = new Util.RuntimeOptions{};
  return createVerifySchemeWithOptions(request, runtime);
}

model DeleteVerifySchemeRequest {
  customerId?: long(name='CustomerId', description='The user ID.', example='12345678'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemeCode?: string(name='SchemeCode', description='The service code.

This parameter is required.', example='FC10000014164****'),
}

model DeleteVerifySchemeResponseBody = {
  code?: string(name='Code', description='The request is successful. For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='E3754956-D0B1-5947-962A-AE767D354F01'),
  result?: boolean(name='Result', description='The result of the operation. Valid values:

*   **true**: The verification service is deleted.
*   **false**: The verification service failed to be deleted.', example='true'),
}

model DeleteVerifySchemeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVerifySchemeResponseBody(name='body'),
}

/**
 * @summary Deletes a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeleteVerifySchemeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVerifySchemeResponse
 */
async function deleteVerifySchemeWithOptions(request: DeleteVerifySchemeRequest, runtime: Util.RuntimeOptions): DeleteVerifySchemeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemeCode)) {
    query['SchemeCode'] = request.schemeCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteVerifyScheme',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeleteVerifySchemeRequest
 * @return DeleteVerifySchemeResponse
 */
async function deleteVerifyScheme(request: DeleteVerifySchemeRequest): DeleteVerifySchemeResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteVerifySchemeWithOptions(request, runtime);
}

model DescribeVerifySchemeRequest {
  customerId?: long(name='CustomerId', description='The user ID.', example='1234****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemeCode?: string(name='SchemeCode', description='The service code.

This parameter is required.', example='FC10000010643****'),
}

model DescribeVerifySchemeResponseBody = {
  code?: string(name='Code', description='The response code. OK indicates that the request is successful. For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='0C5380A7-2032-5F7D-9614-1BF8B54D16CB'),
  schemeQueryResultDTO?: {
    appEncryptInfo?: string(name='AppEncryptInfo', description='The key generated when you create a service in the console.', example='ZDMARqPkyQzWVJjB/sB/+fCp5TA4lNsRnY7rEC+HfGsOIOk1Brj8UyXFW2RBYIWqLieCSo8ZypEaEj+h9rLd3FgpXAjGYDfmOperod6jPUUwFHhBObxK+HuKVoi2jOqN7aDOlyPyGcATyq3BDdlf922JmnFLT8Hvnu4qgzzCZk0LXWTb0XVPnm5/fHUGHEA2Q+aTrGkaWcHjmTDqQ7BtvrAIIcJJkCJu4i1aeU++/0EzGWap4mcb2VhKROBs****'),
  }(name='SchemeQueryResultDTO', description='The response parameters.'),
}

model DescribeVerifySchemeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVerifySchemeResponseBody(name='body'),
}

/**
 * @summary Queries the details of a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DescribeVerifySchemeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVerifySchemeResponse
 */
async function describeVerifySchemeWithOptions(request: DescribeVerifySchemeRequest, runtime: Util.RuntimeOptions): DescribeVerifySchemeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemeCode)) {
    query['SchemeCode'] = request.schemeCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVerifyScheme',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DescribeVerifySchemeRequest
 * @return DescribeVerifySchemeResponse
 */
async function describeVerifyScheme(request: DescribeVerifySchemeRequest): DescribeVerifySchemeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVerifySchemeWithOptions(request, runtime);
}

model GetAuthTokenRequest {
  bizType?: int32(name='BizType'),
  cmApiCode?: int32(name='CmApiCode'),
  ctApiCode?: int32(name='CtApiCode'),
  cuApiCode?: int32(name='CuApiCode'),
  origin?: string(name='Origin', description='The requested domain name.

This parameter is required.', example='https://www.aliyundoc.com'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sceneCode?: string(name='SceneCode'),
  url?: string(name='Url', description='The URL of the requested web page.

This parameter is required.', example='https://www.aliyundoc.com/'),
  version?: string(name='Version'),
}

model GetAuthTokenResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
  tokenInfo?: {
    accessToken?: string(name='AccessToken', description='The business authentication token.

>  AccessToken is valid for 10 minutes and can be used repeatedly within its validity period.', example='agag****'),
    jwtToken?: string(name='JwtToken', description='The API authentication token.

>  JwtToken is valid for 1 hour and can be used repeatedly within its validity period.', example='aweghd****'),
  }(name='TokenInfo', description='The response parameters.'),
}

model GetAuthTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAuthTokenResponseBody(name='body'),
}

/**
 * @summary Obtains the authorization token used for the authentication of the phone number verification for HTML5 pages. You can obtain AccessToken and JwtToken after a successful call.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the phone number verification feature for HTML5 pages](https://help.aliyun.com/document_detail/169786.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetAuthTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAuthTokenResponse
 */
async function getAuthTokenWithOptions(request: GetAuthTokenRequest, runtime: Util.RuntimeOptions): GetAuthTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.cmApiCode)) {
    query['CmApiCode'] = request.cmApiCode;
  }
  if (!Util.isUnset(request.ctApiCode)) {
    query['CtApiCode'] = request.ctApiCode;
  }
  if (!Util.isUnset(request.cuApiCode)) {
    query['CuApiCode'] = request.cuApiCode;
  }
  if (!Util.isUnset(request.origin)) {
    query['Origin'] = request.origin;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sceneCode)) {
    query['SceneCode'] = request.sceneCode;
  }
  if (!Util.isUnset(request.url)) {
    query['Url'] = request.url;
  }
  if (!Util.isUnset(request.version)) {
    query['Version'] = request.version;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAuthToken',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the authorization token used for the authentication of the phone number verification for HTML5 pages. You can obtain AccessToken and JwtToken after a successful call.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the phone number verification feature for HTML5 pages](https://help.aliyun.com/document_detail/169786.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetAuthTokenRequest
 * @return GetAuthTokenResponse
 */
async function getAuthToken(request: GetAuthTokenRequest): GetAuthTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAuthTokenWithOptions(request, runtime);
}

model GetAuthorizationUrlRequest {
  endDate?: string(name='EndDate', description='The authorization end date, which is in the yyyy-MM-dd format. This parameter is required for services of contract type.', example='2020–12–28'),
  ownerId?: long(name='OwnerId'),
  phoneNo?: string(name='PhoneNo', description='The phone number.

This parameter is required.', example='1390000****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemeId?: long(name='SchemeId', description='The ID of the authorization scenario. You can view the ID of the authorization scenario on the **Authorization Scenario Management** page in the **Phone Number Verification Service console**.

This parameter is required.', example='234****'),
}

model GetAuthorizationUrlResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  data?: {
    authorizationUrl?: string(name='AuthorizationUrl', description='The authorization URL.', example='https://render.****.com/p/s/web-call-minapp/auth-bao?page=commauth/index&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJiaXpUeXBlIjoiQ29tbUF1dGgiLCJiaXpJZCI6IjVmNWZjNjAzZDQzMTQ0MWZiYTZiNjYzM2QyMjIyNzU0IiwiZXhwIjoxNjA4MTkxODQxfQ.5IvBj2nKgr60APtotaIB13vtPVrdsPQ6avIfWxte1pA&_env=prod'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model GetAuthorizationUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAuthorizationUrlResponseBody(name='body'),
}

/**
 * @summary Obtains the URL for the Alipay account authorization.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account and obtain an Alibaba Cloud AccessKey pair. For more information, see [Process of communication authorization](https://help.aliyun.com/document_detail/196922.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetAuthorizationUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAuthorizationUrlResponse
 */
async function getAuthorizationUrlWithOptions(request: GetAuthorizationUrlRequest, runtime: Util.RuntimeOptions): GetAuthorizationUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNo)) {
    query['PhoneNo'] = request.phoneNo;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemeId)) {
    query['SchemeId'] = request.schemeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAuthorizationUrl',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the URL for the Alipay account authorization.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account and obtain an Alibaba Cloud AccessKey pair. For more information, see [Process of communication authorization](https://help.aliyun.com/document_detail/196922.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetAuthorizationUrlRequest
 * @return GetAuthorizationUrlResponse
 */
async function getAuthorizationUrl(request: GetAuthorizationUrlRequest): GetAuthorizationUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAuthorizationUrlWithOptions(request, runtime);
}

model GetFusionAuthTokenRequest {
  bundleId?: string(name='BundleId', description='The bundle ID of the app. This parameter is required when Platform is set to iOS.', example='com.example.test'),
  durationSeconds?: long(name='DurationSeconds', description='The validity period of the token. Unit: seconds. Valid values: 900 to 43200.

This parameter is required.', example='900'),
  ownerId?: long(name='OwnerId'),
  packageName?: string(name='PackageName', description='The package name of the app. This parameter is required when Platform is set to Android.', example='com.example.test'),
  packageSign?: string(name='PackageSign', description='The package signature of the app. This parameter is required when Platform is set to Android.', example='47fcc************************278'),
  platform?: string(name='Platform', description='The platform type. Valid values: Android and iOS.

This parameter is required.', example='Android'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemeCode?: string(name='SchemeCode', description='The service code.

This parameter is required.', example='FA1000*************201'),
}

model GetFusionAuthTokenResponseBody = {
  code?: string(name='Code', description='The response code. If OK is returned, the request is successful. Other values indicate that the request failed. For more information, see Error codes.', example='OK'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  model?: string(name='Model', description='The authentication code. The value of this parameter is a string.', example='FKcksloqk***********jalEc+'),
  requestId?: string(name='RequestId', description='The request ID, which is used to locate and troubleshoot issues.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: true false', example='false'),
}

model GetFusionAuthTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFusionAuthTokenResponseBody(name='body'),
}

/**
 * @summary Obtains the verification results by using the token that is obtained from the client SDKs.
 *
 * @param request GetFusionAuthTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFusionAuthTokenResponse
 */
async function getFusionAuthTokenWithOptions(request: GetFusionAuthTokenRequest, runtime: Util.RuntimeOptions): GetFusionAuthTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bundleId)) {
    query['BundleId'] = request.bundleId;
  }
  if (!Util.isUnset(request.durationSeconds)) {
    query['DurationSeconds'] = request.durationSeconds;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.packageName)) {
    query['PackageName'] = request.packageName;
  }
  if (!Util.isUnset(request.packageSign)) {
    query['PackageSign'] = request.packageSign;
  }
  if (!Util.isUnset(request.platform)) {
    query['Platform'] = request.platform;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemeCode)) {
    query['SchemeCode'] = request.schemeCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFusionAuthToken',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the verification results by using the token that is obtained from the client SDKs.
 *
 * @param request GetFusionAuthTokenRequest
 * @return GetFusionAuthTokenResponse
 */
async function getFusionAuthToken(request: GetFusionAuthTokenRequest): GetFusionAuthTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFusionAuthTokenWithOptions(request, runtime);
}

model GetMobileRequest {
  accessToken?: string(name='AccessToken', description='The logon token obtained by the SDK for your app.

This parameter is required.', example='Dfafdafad5422****'),
  outId?: string(name='OutId', description='The external ID.', example='22345****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetMobileResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  getMobileResultDTO?: {
    mobile?: string(name='Mobile', description='The phone number,', example='13900001234'),
  }(name='GetMobileResultDTO', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model GetMobileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMobileResponseBody(name='body'),
}

/**
 * @summary Obtains a phone number for one-click logon.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/84541.html).
 * >  This operation is applicable only to one-click logon or registration. You can call this operation only after you confirm the authorization on the authorization page provided by the SDK for one-click logon. You are prohibited from simulating or bypassing the authorization process. Alibaba Cloud reserves the right to terminate our services and take legal actions against such violations.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetMobileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMobileResponse
 */
async function getMobileWithOptions(request: GetMobileRequest, runtime: Util.RuntimeOptions): GetMobileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessToken)) {
    query['AccessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMobile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains a phone number for one-click logon.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/84541.html).
 * >  This operation is applicable only to one-click logon or registration. You can call this operation only after you confirm the authorization on the authorization page provided by the SDK for one-click logon. You are prohibited from simulating or bypassing the authorization process. Alibaba Cloud reserves the right to terminate our services and take legal actions against such violations.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetMobileRequest
 * @return GetMobileResponse
 */
async function getMobile(request: GetMobileRequest): GetMobileResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMobileWithOptions(request, runtime);
}

model GetPhoneWithTokenRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  spToken?: string(name='SpToken', description='The token for phone number verification that is obtained by the JavaScript SDK. The validity period of the token is 10 minutes for China Telecom, 30 minutes for China Unicom, and 2 minutes for China Mobile. The token can be used only once.

This parameter is required.', example='Dfafdafad542****'),
}

model GetPhoneWithTokenResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  data?: {
    mobile?: string(name='Mobile', description='The phone number.', example='13900001234'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='0F335F48-****-****-****-CA7914FE5D77'),
}

model GetPhoneWithTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPhoneWithTokenResponseBody(name='body'),
}

/**
 * @summary Obtains a phone number for one-click logon. This operation is exclusive to HTML5 pages.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/84541.html).
 * >  This operation is applicable only to one-click logon or registration in HTML5 pages. You can call this operation only after you confirm the authorization on the authorization page provided by the JavaScript SDK. You are prohibited from simulating or bypassing the authorization process. Alibaba Cloud reserves the right to terminate our services and take legal actions against such violations.
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetPhoneWithTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPhoneWithTokenResponse
 */
async function getPhoneWithTokenWithOptions(request: GetPhoneWithTokenRequest, runtime: Util.RuntimeOptions): GetPhoneWithTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.spToken)) {
    query['SpToken'] = request.spToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPhoneWithToken',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains a phone number for one-click logon. This operation is exclusive to HTML5 pages.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/84541.html).
 * >  This operation is applicable only to one-click logon or registration in HTML5 pages. You can call this operation only after you confirm the authorization on the authorization page provided by the JavaScript SDK. You are prohibited from simulating or bypassing the authorization process. Alibaba Cloud reserves the right to terminate our services and take legal actions against such violations.
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetPhoneWithTokenRequest
 * @return GetPhoneWithTokenResponse
 */
async function getPhoneWithToken(request: GetPhoneWithTokenRequest): GetPhoneWithTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPhoneWithTokenWithOptions(request, runtime);
}

model GetSmsAuthTokensRequest {
  bundleId?: string(name='BundleId', description='The ID of the iOS application. This parameter is required if OsType is set to **iOS**.', example='12345****'),
  expire?: long(name='Expire', description='The validity period of the token. Unit: seconds. Valid values: 900 to 43200.

This parameter is required.', example='900'),
  osType?: string(name='OsType', description='The type of the operating system. Valid values: **Android** and **iOS**.

This parameter is required.', example='Android'),
  ownerId?: long(name='OwnerId'),
  packageName?: string(name='PackageName', description='The package name. This parameter is required if OsType is set to **Android**.', example='com.aliqin.mytel.test'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sceneCode?: string(name='SceneCode', description='The service code.

This parameter is required.', example='FC100000134840112'),
  signName?: string(name='SignName', description='The signature. This parameter is required if OsType is set to **Android**.', example='47fcc6615485e83b4100433****'),
  smsCodeExpire?: int32(name='SmsCodeExpire', description='The validity period of the SMS verification code. Unit: seconds. Default value: 180.', example='60'),
  smsTemplateCode?: string(name='SmsTemplateCode', description='The code of the text message template.

This parameter is required.', example='SMS_13987****'),
}

model GetSmsAuthTokensResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  data?: {
    bizToken?: string(name='BizToken', description='The business token.', example='FZSMeRbLCiapIBo65NXNHvGbkGDmhs23XWTZDOtZN0g5n/kqSc2FU27Gc9YhGb6dNn9/L9ZXSYiIB6C6LMLQJjyXjRzt5v6pzZXqnjO4cSuPWYUxJvdc8l8OpucEYe8Mx17HxsHDzj0VC4D5+atcrTpJE6jQ7e2QVNjZIPMwsfxELjQS7c****'),
    expireTime?: long(name='ExpireTime', description='The time when the token expired. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1631526326000'),
    stsAccessKeyId?: string(name='StsAccessKeyId', description='The AccessKey ID.', example='STS.NSqC****'),
    stsAccessKeySecret?: string(name='StsAccessKeySecret', description='The AccessKey secret.', example='VboZ4xbZ****'),
    stsToken?: string(name='StsToken', description='The security token.', example='CAISiQJ1q6Ft5B2yfSjIr5DEDP/BurtW9PemMEfBrEpsOr5K17XjuDz2IHtLfXFsBusYt/U2nWpX5v4clrxIToR7SFbFY9pb6ZhazBisebDGv8HtR3TcFEjiSwapEBfe8JL4QYeQFaHwGJqEb1TDiVUAo9/TfimjWFqIKICAjYUdAP0cQgi/a0gtZr4UXHwAzvUXLnzML/2gHwf3i27LdipStxF7lHl05NbUoKTeyGKH3AGqlLVF9tite8f9NpczBvolDYfpht4RX7HazStd5yJN8KpLl6Fe8V/FxIrGXAAJv0rdbbOFq4Q1c18hOLJHAKtfsvXmlPNpsevfmpnsx****'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model GetSmsAuthTokensResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSmsAuthTokensResponseBody(name='body'),
}

/**
 * @summary Obtains the authorization token for an SMS verification code.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the SMS verification feature](https://help.aliyun.com/document_detail/313209.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetSmsAuthTokensRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSmsAuthTokensResponse
 */
async function getSmsAuthTokensWithOptions(request: GetSmsAuthTokensRequest, runtime: Util.RuntimeOptions): GetSmsAuthTokensResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bundleId)) {
    query['BundleId'] = request.bundleId;
  }
  if (!Util.isUnset(request.expire)) {
    query['Expire'] = request.expire;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.packageName)) {
    query['PackageName'] = request.packageName;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sceneCode)) {
    query['SceneCode'] = request.sceneCode;
  }
  if (!Util.isUnset(request.signName)) {
    query['SignName'] = request.signName;
  }
  if (!Util.isUnset(request.smsCodeExpire)) {
    query['SmsCodeExpire'] = request.smsCodeExpire;
  }
  if (!Util.isUnset(request.smsTemplateCode)) {
    query['SmsTemplateCode'] = request.smsTemplateCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSmsAuthTokens',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the authorization token for an SMS verification code.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the SMS verification feature](https://help.aliyun.com/document_detail/313209.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetSmsAuthTokensRequest
 * @return GetSmsAuthTokensResponse
 */
async function getSmsAuthTokens(request: GetSmsAuthTokensRequest): GetSmsAuthTokensResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSmsAuthTokensWithOptions(request, runtime);
}

model JyCreateVerifySchemeRequest {
  appName?: string(name='AppName', description='This parameter is required.'),
  bundleId?: string(name='BundleId'),
  cmApiCode?: long(name='CmApiCode', example='1'),
  ctApiCode?: long(name='CtApiCode', example='3'),
  cuApiCode?: long(name='CuApiCode', example='2'),
  osType?: string(name='OsType', description='This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  packName?: string(name='PackName'),
  packSign?: string(name='PackSign'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemeName?: string(name='SchemeName', description='This parameter is required.'),
}

model JyCreateVerifySchemeResponseBody = {
  code?: string(name='Code'),
  gateVerifySchemeData?: {
    schemeCode?: string(name='SchemeCode'),
  }(name='GateVerifySchemeData'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model JyCreateVerifySchemeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: JyCreateVerifySchemeResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI JyCreateVerifyScheme is deprecated, please use Dypnsapi::2017-05-25::CreateVerifyScheme instead.
 *
 * @summary 创建方案号（为极意临时定制）
 *
 * @param request JyCreateVerifySchemeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return JyCreateVerifySchemeResponse
 */
// Deprecated
async function jyCreateVerifySchemeWithOptions(request: JyCreateVerifySchemeRequest, runtime: Util.RuntimeOptions): JyCreateVerifySchemeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.bundleId)) {
    query['BundleId'] = request.bundleId;
  }
  if (!Util.isUnset(request.cmApiCode)) {
    query['CmApiCode'] = request.cmApiCode;
  }
  if (!Util.isUnset(request.ctApiCode)) {
    query['CtApiCode'] = request.ctApiCode;
  }
  if (!Util.isUnset(request.cuApiCode)) {
    query['CuApiCode'] = request.cuApiCode;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.packName)) {
    query['PackName'] = request.packName;
  }
  if (!Util.isUnset(request.packSign)) {
    query['PackSign'] = request.packSign;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemeName)) {
    query['SchemeName'] = request.schemeName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'JyCreateVerifyScheme',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI JyCreateVerifyScheme is deprecated, please use Dypnsapi::2017-05-25::CreateVerifyScheme instead.
 *
 * @summary 创建方案号（为极意临时定制）
 *
 * @param request JyCreateVerifySchemeRequest
 * @return JyCreateVerifySchemeResponse
 */
// Deprecated
async function jyCreateVerifyScheme(request: JyCreateVerifySchemeRequest): JyCreateVerifySchemeResponse {
  var runtime = new Util.RuntimeOptions{};
  return jyCreateVerifySchemeWithOptions(request, runtime);
}

model JyQueryAppInfoBySceneCodeRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sceneCode?: string(name='SceneCode', description='This parameter is required.'),
}

model JyQueryAppInfoBySceneCodeResponseBody = {
  code?: string(name='Code'),
  data?: {
    cmAppId?: string(name='CmAppId'),
    cmAppKey?: string(name='CmAppKey'),
    ctAppId?: string(name='CtAppId'),
    ctAppKey?: string(name='CtAppKey'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model JyQueryAppInfoBySceneCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: JyQueryAppInfoBySceneCodeResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI JyQueryAppInfoBySceneCode is deprecated, please use Dypnsapi::2017-05-25::QueryAppInfoBySceneCode instead.
 *
 * @summary 根据方案号查询运营商APP信（为极意临时定制）
 *
 * @param request JyQueryAppInfoBySceneCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return JyQueryAppInfoBySceneCodeResponse
 */
// Deprecated
async function jyQueryAppInfoBySceneCodeWithOptions(request: JyQueryAppInfoBySceneCodeRequest, runtime: Util.RuntimeOptions): JyQueryAppInfoBySceneCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sceneCode)) {
    query['SceneCode'] = request.sceneCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'JyQueryAppInfoBySceneCode',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI JyQueryAppInfoBySceneCode is deprecated, please use Dypnsapi::2017-05-25::QueryAppInfoBySceneCode instead.
 *
 * @summary 根据方案号查询运营商APP信（为极意临时定制）
 *
 * @param request JyQueryAppInfoBySceneCodeRequest
 * @return JyQueryAppInfoBySceneCodeResponse
 */
// Deprecated
async function jyQueryAppInfoBySceneCode(request: JyQueryAppInfoBySceneCodeRequest): JyQueryAppInfoBySceneCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return jyQueryAppInfoBySceneCodeWithOptions(request, runtime);
}

model QueryGateVerifyBillingPublicRequest {
  authenticationType?: int32(name='AuthenticationType', description='The verification method. Valid values:

*   **0**: phone number verification
*   **1**: one-click logon
*   **2**: all
*   **3**: facial recognition
*   **4**: SMS verification

This parameter is required.', example='1'),
  month?: string(name='Month', description='The month in which the bill is generated. Specify this parameter in the YYYYMM format. Example: 202111.

This parameter is required.', example='202111'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model QueryGateVerifyBillingPublicResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  data?: {
    amountSum?: string(name='AmountSum', description='The fees generated for all verification services. Unitrogen: CNY.', example='1234'),
    sceneBillingList?: [ 
      {
        add?: string(name='Add', description='The billable items.', example='74'),
        amount?: string(name='Amount', description='The fees generated for the verification service. Unitrogen: CNY.', example='1.48'),
        appName?: string(name='AppName', description='The application name.', example='Aliyun'),
        itemName?: string(name='ItemName', description='The verification method.', example='Verification of local phone number'),
        sceneCode?: string(name='SceneCode', description='The service code.', example='FC100000038194004'),
        sceneName?: string(name='SceneName', description='The service name.', example='Alibaba Cloud Communications'),
        singlePrice?: string(name='SinglePrice', description='The unit price. Unit: CNY.', example='0.02'),
      }
    ](name='SceneBillingList', description='The details of fees.'),
  }(name='Data', description='The billing information about each verification service.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model QueryGateVerifyBillingPublicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryGateVerifyBillingPublicResponseBody(name='body'),
}

/**
 * @summary Queries the fees generated by a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QueryGateVerifyBillingPublicRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryGateVerifyBillingPublicResponse
 */
async function queryGateVerifyBillingPublicWithOptions(request: QueryGateVerifyBillingPublicRequest, runtime: Util.RuntimeOptions): QueryGateVerifyBillingPublicResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authenticationType)) {
    query['AuthenticationType'] = request.authenticationType;
  }
  if (!Util.isUnset(request.month)) {
    query['Month'] = request.month;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryGateVerifyBillingPublic',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the fees generated by a verification service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QueryGateVerifyBillingPublicRequest
 * @return QueryGateVerifyBillingPublicResponse
 */
async function queryGateVerifyBillingPublic(request: QueryGateVerifyBillingPublicRequest): QueryGateVerifyBillingPublicResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryGateVerifyBillingPublicWithOptions(request, runtime);
}

model QueryGateVerifyStatisticPublicRequest {
  authenticationType?: int32(name='AuthenticationType', description='The verification method. Valid values:

*   **1**: one-click logon
*   **2**: phone number verification, including the verification of the phone number used in HTML5 pages
*   **3**: SMS verification
*   **4**: facial recognition

This parameter is required.', example='1'),
  endDate?: string(name='EndDate', description='The end date. Specify this parameter in the YYYYMMDD format. Example: 20220106.

This parameter is required.', example='20220106'),
  osType?: string(name='OsType', description='The type of the operating system. Valid values:

*   **Android**
*   **iOS**', example='Android'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  sceneCode?: string(name='SceneCode', description='The service code.', example='FC100000038194004'),
  startDate?: string(name='StartDate', description='The start date. Specify this parameter in the YYYYMMDD format. Example: 20220101.

This parameter is required.', example='20220101'),
}

model QueryGateVerifyStatisticPublicResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  data?: {
    dayStatistic?: [ 
      {
        statisticDateStr?: string(name='StatisticDateStr', description='The date. This field is accurate to the day. The value of this field is in the YYYYMMDD format. Example: 20220103.', example='20220103'),
        totalFail?: long(name='TotalFail', description='The failed calls on the day.', example='20'),
        totalSuccess?: long(name='TotalSuccess', description='The successful calls on the day.', example='0'),
        totalUnknown?: long(name='TotalUnknown', description='The unknown calls on the day.', example='0'),
      }
    ](name='DayStatistic', description='The information about the daily calls.'),
    total?: long(name='Total', description='The total calls.', example='20'),
    totalFail?: long(name='TotalFail', description='The failed calls.', example='20'),
    totalSuccess?: long(name='TotalSuccess', description='The successful calls.', example='0'),
    totalUnknown?: long(name='TotalUnknown', description='The unknown calls.', example='0'),
  }(name='Data', description='The information about the calls of Phone Number Verification Service, including the total calls, the successful calls, failed calls, unknown calls, and daily calls within the statistical date range.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model QueryGateVerifyStatisticPublicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryGateVerifyStatisticPublicResponseBody(name='body'),
}

/**
 * @summary Queries the calls of Phone Number Verification Service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QueryGateVerifyStatisticPublicRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryGateVerifyStatisticPublicResponse
 */
async function queryGateVerifyStatisticPublicWithOptions(request: QueryGateVerifyStatisticPublicRequest, runtime: Util.RuntimeOptions): QueryGateVerifyStatisticPublicResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authenticationType)) {
    query['AuthenticationType'] = request.authenticationType;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.sceneCode)) {
    query['SceneCode'] = request.sceneCode;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryGateVerifyStatisticPublic',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the calls of Phone Number Verification Service.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QueryGateVerifyStatisticPublicRequest
 * @return QueryGateVerifyStatisticPublicResponse
 */
async function queryGateVerifyStatisticPublic(request: QueryGateVerifyStatisticPublicRequest): QueryGateVerifyStatisticPublicResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryGateVerifyStatisticPublicWithOptions(request, runtime);
}

model QuerySendDetailsRequest {
  bizId?: string(name='BizId', description='The unique ID of the business, which is provided by Alibaba Cloud.', example='1231891289318923^12'),
  currentPage?: long(name='CurrentPage', description='The number of the page on which you are reading the text message. Pages start from page 1. The value of this parameter cannot exceed the maximum page number.

This parameter is required.', example='1'),
  ownerId?: long(name='OwnerId'),
  pageSize?: long(name='PageSize', description='The number of entries per page.

This parameter is required.', example='50'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number.

This parameter is required.', example='186****9399'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendDate?: string(name='SendDate', description='The date when the text message was sent. You can query text messages that were sent within the last 30 days.

Specify the date in the yyyyMMdd format. Example: 20181225.

This parameter is required.', example='20181225'),
}

model QuerySendDetailsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.', example='none'),
  code?: string(name='Code', description='The response code.

If OK is returned, the request is successful. Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html?spm=a2c4g.419277.0.i11).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  model?: [ 
    {
      content?: string(name='Content', description='The content of the text message.', example='203160'),
      errCode?: string(name='ErrCode', description='The status code returned by the carrier.

*   If the text message was delivered, "DELIVERED" is returned.
*   If the text message failed to be sent, see [Error codes](https://help.aliyun.com/document_detail/101347.html?spm=a2c4g.419277.0.i8) for more information.', example='DELIVERED'),
      outId?: string(name='OutId', description='The extension field.', example='12131231'),
      phoneNum?: string(name='PhoneNum', description='The phone number.', example='1390000****'),
      receiveDate?: string(name='ReceiveDate', description='The date and time when the text message was received.', example='2019-01-08 16:44:13'),
      sendDate?: string(name='SendDate', description='The date when the text message was sent. You can query text messages that were sent within the last 30 days.

The date is in the yyyyMMdd format. Example: 20181225.', example='2019-01-08 16:44:13'),
      sendStatus?: long(name='SendStatus', description='The delivery status of the text message.

*   1: A delivery receipt is to be sent.
*   2: The text message failed to be sent.
*   3: The text message was sent.', example='3'),
      templateCode?: string(name='TemplateCode', description='The code of the text message template.

Log on to the SMS console. In the left-side navigation pane, click **Go China** or **Go Globe**. You can view the text message template code in the **Template Code** column on the **Message Templates** tab.

>  The text message templates must be created on the Go Globe page and approved.', example='SMS_12231****'),
    }
  ](name='Model', description='The returned data.'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of entries in the list.', example='42'),
}

model QuerySendDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySendDetailsResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI QuerySendDetails is deprecated
 *
 * @summary Queries the delivery status of the SMS verification code. You can query only the delivery status of the SMS verification code that is sent by calling corresponding API operations.
 *
 * @param request QuerySendDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySendDetailsResponse
 */
// Deprecated
async function querySendDetailsWithOptions(request: QuerySendDetailsRequest, runtime: Util.RuntimeOptions): QuerySendDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendDate)) {
    query['SendDate'] = request.sendDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySendDetails',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI QuerySendDetails is deprecated
 *
 * @summary Queries the delivery status of the SMS verification code. You can query only the delivery status of the SMS verification code that is sent by calling corresponding API operations.
 *
 * @param request QuerySendDetailsRequest
 * @return QuerySendDetailsResponse
 */
// Deprecated
async function querySendDetails(request: QuerySendDetailsRequest): QuerySendDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySendDetailsWithOptions(request, runtime);
}

model SendSmsVerifyCodeRequest {
  codeLength?: long(name='CodeLength', description='The length of the verification code. Default value: 4. Valid values: 4 to 8.', example='4'),
  codeType?: long(name='CodeType', description='The type of the generated verification code. Default value: 1. Valid values:

*   1: digits only
*   2: uppercase letters only
*   3: lowercase letters only
*   4: uppercase and lowercase letters
*   5: digits and uppercase letters
*   6: digits and lowercase letters
*   7: digits and uppercase and lowercase letters', example='1'),
  countryCode?: string(name='CountryCode', description='The country code of the phone number. SMS verification codes can be sent only by using phone numbers in the Chinese mainland. Default value: 86.', example='86'),
  duplicatePolicy?: long(name='DuplicatePolicy', description='Specifies how to handle the verification codes received earlier in a case where verification codes are sent to the same phone number for the same scenario within the validity period.

*   1 (default): The latest verification code overwrites the verification codes received earlier. In this case, verification codes received earlier expire.
*   2: Verification codes within their validity period are valid and can be used for verification.', example='1'),
  interval?: long(name='Interval', description='The time interval. Unit: seconds. Default value: 60. This parameter specifies how often you can send a verification code.', example='60'),
  outId?: string(name='OutId', description='The external ID.', example='12358794Aqzaq'),
  ownerId?: long(name='OwnerId'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number.

This parameter is required.', example='86130****0000'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  returnVerifyCode?: boolean(name='ReturnVerifyCode', description='Specifies whether to return a verification code.

*   **true**
*   **false**', example='false'),
  schemeName?: string(name='SchemeName', description='The verification service name. If this parameter is not specified, the default service is used. The name can be up to 20 characters in length.', example='Aliyun'),
  signName?: string(name='SignName', description='The signature.

This parameter is required.', example='Aliyun Test'),
  smsUpExtendCode?: string(name='SmsUpExtendCode', description='The extension code of the upstream text message. Upstream text messages are text messages sent to the communication service provider. Upstream text messages are used to customize a service, complete an inquiry, or send a request. You are charged for sending upstream text messages based on the billing standards of the service provider.

>  The extension code is automatically generated by the system when the signature is generated. You do not need to specify the extension code. You can skip this parameter based on your business requirements. If you want to use custom extension codes, contact your account manager.', example='1213123'),
  templateCode?: string(name='TemplateCode', description='The code of the text message template.

Log on to the [SMS console](https://dysms.console.aliyun.com/dysms.htm?spm=5176.12818093.categories-n-products.ddysms.3b2816d0xml2NA#/overview). In the left-side navigation pane, click **Go China** or **Go Globe**. You can view the text message template code in the **Template Code** column on the **Message Templates** tab.

>  The text message templates must be created on the Go Globe page and approved.

This parameter is required.', example='azsq_*****'),
  templateParam?: string(name='TemplateParam', description='The value of the variable in the text message template. The verification code is replaced with "##code##".

Example 1: For a system-defined template that contains variables, if the template content is "Your verification code is ${code} and valid for 5 minutes. Do not disclose the verification code to others.", specify the value of this parameter as {"code":"##code##"}

Example 2: For a custom template, if the template content is ${content}, specify the value of this parameter as {"content":"Your verification code is ##code## and must be used within 5 minutes."}.

> 

*   If line breaks are required in JSON-formatted data, they must meet the relevant requirements that are specified in the standard JSON protocol.

*   For more information about template variables, see [SMS template specifications](https://help.aliyun.com/document_detail/108253.html).

This parameter is required.', example='{"code":"##code##"}'),
  validTime?: long(name='ValidTime', description='The validity period of the verification code. Unit: seconds. Default value: 300.', example='300'),
}

model SendSmsVerifyCodeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.', example='None'),
  code?: string(name='Code', description='The response code. If OK is returned, the request is successful. For more information, see [Response codes](https://help.aliyun.com/zh/pnvs/developer-reference/api-return-code?spm=a2c4g.11174283.0.0.70c5616bkj38Wa).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  model?: {
    bizId?: string(name='BizId', description='The business ID.', example='112231421412414124123^4'),
    outId?: string(name='OutId', description='The external ID.', example='1231231313'),
    requestId?: string(name='RequestId', description='The request ID.', example='API-reqelekrqkllkkewrlwrjlsdfsdf'),
    verifyCode?: string(name='VerifyCode', description='The verification code.', example='42324'),
  }(name='Model', description='The returned data.'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model SendSmsVerifyCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendSmsVerifyCodeResponseBody(name='body'),
}

/**
 * @summary Sends SMS verification codes.
 *
 * @param request SendSmsVerifyCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendSmsVerifyCodeResponse
 */
async function sendSmsVerifyCodeWithOptions(request: SendSmsVerifyCodeRequest, runtime: Util.RuntimeOptions): SendSmsVerifyCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.codeLength)) {
    query['CodeLength'] = request.codeLength;
  }
  if (!Util.isUnset(request.codeType)) {
    query['CodeType'] = request.codeType;
  }
  if (!Util.isUnset(request.countryCode)) {
    query['CountryCode'] = request.countryCode;
  }
  if (!Util.isUnset(request.duplicatePolicy)) {
    query['DuplicatePolicy'] = request.duplicatePolicy;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.returnVerifyCode)) {
    query['ReturnVerifyCode'] = request.returnVerifyCode;
  }
  if (!Util.isUnset(request.schemeName)) {
    query['SchemeName'] = request.schemeName;
  }
  if (!Util.isUnset(request.signName)) {
    query['SignName'] = request.signName;
  }
  if (!Util.isUnset(request.smsUpExtendCode)) {
    query['SmsUpExtendCode'] = request.smsUpExtendCode;
  }
  if (!Util.isUnset(request.templateCode)) {
    query['TemplateCode'] = request.templateCode;
  }
  if (!Util.isUnset(request.templateParam)) {
    query['TemplateParam'] = request.templateParam;
  }
  if (!Util.isUnset(request.validTime)) {
    query['ValidTime'] = request.validTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendSmsVerifyCode',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sends SMS verification codes.
 *
 * @param request SendSmsVerifyCodeRequest
 * @return SendSmsVerifyCodeResponse
 */
async function sendSmsVerifyCode(request: SendSmsVerifyCodeRequest): SendSmsVerifyCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendSmsVerifyCodeWithOptions(request, runtime);
}

model VerifyMobileRequest {
  accessCode?: string(name='AccessCode', description='The token obtained by the SDK for your app.

This parameter is required.', example='Dfafdafad542****'),
  outId?: string(name='OutId', description='The external ID.', example='123456'),
  ownerId?: long(name='OwnerId'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number.

This parameter is required.', example='13800****00'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model VerifyMobileResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  gateVerifyResultDTO?: {
    verifyId?: string(name='VerifyId', description='The verification ID.', example='121343241'),
    verifyResult?: string(name='VerifyResult', description='The verification results. Valid values:

*   **PASS: The input phone number is consistent with the phone number that you use.**
*   **REJECT: The input phone number is different from the phone number that you use.**
*   **UNKNOWN: The system cannot judge whether the input phone number is consistent with the phone number that you use.', example='PASS'),
  }(name='GateVerifyResultDTO', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model VerifyMobileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyMobileResponseBody(name='body'),
}

/**
 * @summary Verifies the phone number that you use.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/84541.html).
 * >  This operation is applicable to only the verification of thephone number that you use. To obtain a phone number for one-click logon, call [GetMobile](https://help.aliyun.com/document_detail/189865.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifyMobileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyMobileResponse
 */
async function verifyMobileWithOptions(request: VerifyMobileRequest, runtime: Util.RuntimeOptions): VerifyMobileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessCode)) {
    query['AccessCode'] = request.accessCode;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyMobile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies the phone number that you use.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/84541.html).
 * >  This operation is applicable to only the verification of thephone number that you use. To obtain a phone number for one-click logon, call [GetMobile](https://help.aliyun.com/document_detail/189865.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifyMobileRequest
 * @return VerifyMobileResponse
 */
async function verifyMobile(request: VerifyMobileRequest): VerifyMobileResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyMobileWithOptions(request, runtime);
}

model VerifyPhoneWithTokenRequest {
  ownerId?: long(name='OwnerId'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number.

This parameter is required.', example='1380000****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  spToken?: string(name='SpToken', description='The token for phone number verification that is obtained by the JavaScript SDK.

This parameter is required.', example='Dfafdafad542****'),
}

model VerifyPhoneWithTokenResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  gateVerify?: {
    verifyId?: string(name='VerifyId', description='The external ID.', example='12134****'),
    verifyResult?: string(name='VerifyResult', description='The verification results. Valid values:

*   PASS: The input phone number is consistent with the phone number used in HTML5 pages.
*   REJECT: The input phone number is different from the phone number used in HTML5 pages.
*   UNKNOWN: The system cannot judge whether the input phone number is consistent with the phone number used in HTML5 pages.', example='PASS'),
  }(name='GateVerify', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model VerifyPhoneWithTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyPhoneWithTokenResponseBody(name='body'),
}

/**
 * @summary Verifies the phone number used in HTML5 pages.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the phone number verification feature for HTML5 pages](https://help.aliyun.com/document_detail/169786.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifyPhoneWithTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyPhoneWithTokenResponse
 */
async function verifyPhoneWithTokenWithOptions(request: VerifyPhoneWithTokenRequest, runtime: Util.RuntimeOptions): VerifyPhoneWithTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.spToken)) {
    query['SpToken'] = request.spToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyPhoneWithToken',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies the phone number used in HTML5 pages.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the phone number verification feature for HTML5 pages](https://help.aliyun.com/document_detail/169786.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifyPhoneWithTokenRequest
 * @return VerifyPhoneWithTokenResponse
 */
async function verifyPhoneWithToken(request: VerifyPhoneWithTokenRequest): VerifyPhoneWithTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyPhoneWithTokenWithOptions(request, runtime);
}

model VerifySmsCodeRequest {
  phoneNumber?: string(name='PhoneNumber', description='The phone number, which is used to receive SMS verification codes.

This parameter is required.', example='1321111****'),
  smsCode?: string(name='SmsCode', description='The SMS verification code.

This parameter is required.', example='12****'),
  smsToken?: string(name='SmsToken', description='The text message verification code. After you successfully call the corresponding API operation to send the SMS verification code, the end users receive the SMS verification code. SmsToken is returned by the SDK for SMS verification for you to verify the text message verification code. For an Android client, sendVerifyCode is called to send the verification code. For an iOS client, sendVerifyCodeWithTimeout is called to send the verification code. For more information, see [Overview](https://help.aliyun.com/document_detail/400434.html).

This parameter is required.', example='sddsbvdbvjd****'),
}

model VerifySmsCodeResponseBody = {
  code?: string(name='Code', description='The response code.

*   If OK is returned, the request is successful.
*   For more information about other error codes, see [API response codes](https://help.aliyun.com/document_detail/85198.html).', example='OK'),
  data?: boolean(name='Data', description='Indicates whether the request is successful. Valid values:

*   **true**
*   **false**', example='true'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model VerifySmsCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifySmsCodeResponseBody(name='body'),
}

/**
 * @summary Verifies SMS verification codes.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the SMS verification feature](https://help.aliyun.com/document_detail/313209.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifySmsCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifySmsCodeResponse
 */
async function verifySmsCodeWithOptions(request: VerifySmsCodeRequest, runtime: Util.RuntimeOptions): VerifySmsCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.smsCode)) {
    query['SmsCode'] = request.smsCode;
  }
  if (!Util.isUnset(request.smsToken)) {
    query['SmsToken'] = request.smsToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifySmsCode',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies SMS verification codes.
 *
 * @description ### [](#)Preparations
 * You must register an Alibaba Cloud account, obtain an Alibaba Cloud AccessKey pair, and create a verification service. For more information, see [Use the SMS verification feature](https://help.aliyun.com/document_detail/313209.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifySmsCodeRequest
 * @return VerifySmsCodeResponse
 */
async function verifySmsCode(request: VerifySmsCodeRequest): VerifySmsCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifySmsCodeWithOptions(request, runtime);
}

model VerifyWithFusionAuthTokenRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  verifyToken?: string(name='VerifyToken', description='The unified verification token that is returned by the client SDKs.

This parameter is required.', example='LD108enNdlsl*******sFLKCks1=='),
}

model VerifyWithFusionAuthTokenResponseBody = {
  code?: string(name='Code', description='The response code. If OK is returned, the request is successful. Other values indicate that the request failed. For more information, see Error codes.', example='OK'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  model?: {
    phoneNumber?: string(name='PhoneNumber', description='The phone number, which is returned when the verification is successful.', example='180********'),
    phoneScore?: long(name='PhoneScore', description='The phone number score, which is generated only after the phone number scoring node is enabled and the verification is successful. The higher the score, the more risky the phone number. Valid values: 0 to 100.', example='20'),
    verifyResult?: string(name='VerifyResult', description='The verification result. Valid values: PASS and UNKNOWN.', example='PASS'),
  }(name='Model', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID, which is used to troubleshoot issues.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: true false', example='true'),
}

model VerifyWithFusionAuthTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyWithFusionAuthTokenResponseBody(name='body'),
}

/**
 * @summary Obtains the verification results by using the verification token that is obtained by using the authentication token.
 *
 * @param request VerifyWithFusionAuthTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyWithFusionAuthTokenResponse
 */
async function verifyWithFusionAuthTokenWithOptions(request: VerifyWithFusionAuthTokenRequest, runtime: Util.RuntimeOptions): VerifyWithFusionAuthTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.verifyToken)) {
    query['VerifyToken'] = request.verifyToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyWithFusionAuthToken',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the verification results by using the verification token that is obtained by using the authentication token.
 *
 * @param request VerifyWithFusionAuthTokenRequest
 * @return VerifyWithFusionAuthTokenResponse
 */
async function verifyWithFusionAuthToken(request: VerifyWithFusionAuthTokenRequest): VerifyWithFusionAuthTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyWithFusionAuthTokenWithOptions(request, runtime);
}

